const app = getApp()
Page({
  data: {
    list:{},
    stock_name:'',
   con:[
    {
      "stockid":"1",
      "image1":"../image/003.jpg",
      "shopName": "ps5",
      "price": 3899,
      "score":3899,
    },
    {
      "stockid":"1",
      "image1": "../image/004.jpg",
      "shopName": "xbox",
      "price": 2899,
      "score": 3899,
    },
    {
      "image1": "../image/005.jpg",
      "shopName": "switch",
      "price": 2899,
      "score":2899,
    },
    {
      "image1": "../image/003.jpg",
      "shopName": "ps5",
      "price": 3899,
      "score":3899,
    },
    {
      "image1": "../image/004.jpg",
      "shopName": "xbox",
      "price": 2899,
      "score": 3899,
    },
    {
      "image1": "../image/005.jpg",
      "shopName": "switch",
      "price": 2899,
      "score":2899,
    },
  ],
  },
  input_search:function(e){
    this.setData({
      stockName:e.detail.value
    });
  },
  searchbind:function(e){
    var that=this
    wx.navigateTo({
      url: '/pages/searchshow/searchshow?stockName='+that.data.stockName
      
    })
  },
  onLoad() {
    // console.log(app.globalData.userInfoList.userId)
    wx.setNavigationBarTitle({
    title: '主页' 
  }),
  // this.setData({
  //   gameImage:app.globalData.gameImage
  // })
    // console.log(this.gameImage[1].src)
    wx.request({
      url: app.globalData.url+'SelectAllStock',
      success:(res)=>{
        app.globalData.stocklist=res.data
        console.log(res.data)
        this.setData({
           list: res.data
        })
      },
    })
  },

})
